package org.gruposp2p.aularest.server;

import java.util.logging.Logger;
import org.gruposp2p.aularest.utils.AulaLogger;
import org.restlet.Component;
import org.restlet.data.Parameter;
import org.restlet.data.Protocol;
import org.restlet.util.Series;
import org.gruposp2p.aularest.utils.DatabaseInstaller;

/**
 *
 * @author jj
 */
public class AulaServer extends Component {

    private static final Logger logger =
        AulaLogger.getLogger(AulaServer.class.getName());

    public static void main(String[] args) throws Exception {
        AulaServer aulawebServer = new AulaServer();
        aulawebServer.getServers().add(Protocol.HTTP, 8888);
        aulawebServer.start();
    }
    private Series<Parameter> parameters;

    public AulaServer() {
        //getClients().add(Protocol.CLAP);
        //getClients().add(Protocol.FILE);
        
        synchronized (this){
            DatabaseInstaller.install();
        }
        getDefaultHost().attach(new AulaApplication());
    }

    
}
